<template>
  <div>
    <van-nav-bar
        left-text="取消"
        right-text="完成"
        title="修改昵称"
        @click-left="$emit('close')"
        @click-right="$emit('onConfirm',localName)"
      ></van-nav-bar>
      <van-field
        class="field"
        v-model="localName"
        rows="2"
        autosize
        type="textarea"
        maxlength="7"
        placeholder="请输入留言"
        show-word-limit
      />
  </div>
</template>

<script>
export default {
  name: "UpdataName",
  created() {},
  data() {
    return {
      // 因为v-model 双向数据绑定会修改 props值 但是 props只允许修改 object和array
      localName:this.name
    };
  }
  ,
  methods: {

  },
  props:{
    name:{
      type:String
    }
  }
};
</script>

<style lang="less" scoped></style>
